home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_FONT / Source / FontConverter.h < prev    next >
Text File  |  1995-06-12  |  4KB  |  104 lines

  1. /***********************************************************************
  2. Converter class for Convert FONT which converts Mac fonts to NeXT fonts.
  3. Copyright (C) 1993 David John Burrowes
  4.  
  5. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.
  6.  
  7. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  8.  
  9. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  10.  
  11. The author, David John Burrowes, can be reached at:
  12.     davidjohn@kira.net.netcom.com
  13.     David John Burrowes
  14.     1926 Ivy #10
  15.     San Mateo, CA 94403-1367
  16. ***********************************************************************/
  17.  
  18.  
  19.  
  20. /*
  21. ====================================================================
  22. This is the interface file for the FontConverter class.  Full documentation for this class can be found in the FontConverter.rtf file (someday).  I will not duplicate all that fine information here.
  23. The quick summary: This just reads the binary file that contains a Macintosh Font definitino (bitmap, not that new-fangled TrueType stuff) and writes it out at a Type 3 PS font....
  24.     This is $Revision: 1.2 $ of this file
  25.     It was last modified by $Author: death $ on $Date: 93/04/04 23:42:46 $
  26. Note that this file was created while using the New Century Schoolbook Roman typeface.  You may find that some things line up strangely if you don't use that family.
  27.  *$Log:    FontConverter.h,v $
  28.  * Revision 1.2  93/04/04  23:42:46  death
  29.  * Sun Apr  4 23:42:46 PDT 1993
  30.  * 
  31.  * Revision 1.1  93/01/10  15:01:47  death
  32.  * Sun Jan 10 15:01:47 PST 1993
  33.  * 
  34.  * 
  35.  *====================================================================
  36.  */
  37.  
  38. //
  39. //    Import our parent class' definition
  40. //
  41. #import "AbstractConverter.h"
  42. #import "common.h"
  43. #import "MacTypes.h"
  44.  
  45. //////
  46. //    Define the Font record.
  47. //////
  48.  
  49. typedef struct {
  50.     INTEGER    fontType;         /*font type*/
  51.     INTEGER    firstChar;        /*ASCII code of first character*/
  52.     INTEGER    lastChar;         /*ASCII code of last character*/
  53.     INTEGER    widMax;            /*maximum character width*/
  54.     INTEGER    kernMax;        /*negative of maximum character kern*/
  55.     INTEGER    nDescent;         /*negative of descent*/
  56.     INTEGER    fRectWidth;        /*width of font rectangle*/
  57.     INTEGER    fRectHeight;        /*height of font rectangle*/
  58.     INTEGER    owTLoc;            /*offset to offset/width table*/
  59.     INTEGER    ascent;            /*ascent*/
  60.     INTEGER    descent;            /*descent*/
  61.     INTEGER    leading;            /*leading*/
  62.     INTEGER    rowWords;         /*row width of bit image / 2 */
  63.     Byte        ImageAndTables;
  64. } FontRec, *FontRecPtr;
  65.  
  66. typedef struct {
  67.     CHAR    offset, width;
  68. } OWEntry;
  69.  
  70.  
  71. #define    propFont    0x9000
  72. #define    fixedFont 0xB000
  73.  
  74.  
  75.  
  76. @interface FontConverter:AbstractConverter
  77. {
  78.     CString    EncodingVector[256];
  79.     CString    NSEncodingVector[256];
  80.     CString    StoredName;
  81.     Boolean    UseNSEncoding;
  82.     Integer    MacToNeXTLookup[256];
  83. }
  84.  
  85. - init;
  86. - free;
  87. - (Boolean) isThisAGoodFile: theFile;
  88.  
  89. - SetNSEncodingUse: (Boolean) NSEncodingFlag;
  90.  
  91. - (ByteString) Copy: (PositiveInteger) sourceSize
  92.     BitsAtOffset: (PositiveInteger) offset
  93.     From: (ByteString) source
  94.     Into: (ByteString) dest;
  95. - ConvertMacFONT: SourceFile ToType3Font: DestFile AndAFM: afmFile;
  96. - (FontRecPtr) GetFontRecordWithLength: (PositiveInteger) fontLength From: SourceFile;
  97. -SetFullNameTo: (ConstCString) filename;
  98. @end;
  99.  
  100.  
  101.  
  102. #define    ERR_BADSOURCESIZE    201
  103.  
  104.